<?php

// Define path to application directory
defined('MODULES_PATH')
    || define('MODULES_PATH', realpath(dirname(__FILE__)));

// Define application environment
defined('MODULES_ENV')
    || define('MODULES_ENV', (getenv('MODULES_ENV') ? getenv('MODULES_ENV') : 'production'));

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(MODULES_PATH . '/../library'),
    get_include_path(),
)));

/** Zend_Application */
require_once 'Zend/Application.php';  

// Create application, bootstrap, and run
$application = new Zend_Application(
    MODULES_ENV, 
    MODULES_PATH . '/../private/application.ini'
);

$application->bootstrap()
            ->run();
